    <style>

      body{
      	background-color: #6C8697;
      }
      #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px;
        width:100%;
        height:80%;
        text-align: center;
      }
    </style>

 <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/jquery.cleditor.css" />
<nav class="navbar navbar-admin" role="navigation">
  <div class="container-fluid">

<ul class="nav nav-pills">
  <li class="active"><a href="#">Home</a></li>
  <li><a href="#">Productos</a></li>
  <li><a href="#">Correos</a></li>
</ul>

<ul class="nav navbar-nav navbar-right">
<li><a href="#">PULLI ADMIN <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/admin-icon.png" alt=""></a></li>

</ul>
</div>
</nav>

<div class="container">



	<div class="jumbotron jumbo-pulli">
		<div id="owl-demo" class="owl-carousel owl-theme">
		 
		  <div class="item"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/slide1.png" alt="The Last of us"></div>
		  <div class="item"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/slide2.png" alt="GTA V"></div>
		  <div class="item"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/slide3.png" alt="Mirror Edge"></div>
		 
		</div>
		<div class="jumbo-bottom">
		<div class="row">
			<div class="col-lg-2 col-sm-3 jumbo-sn">
				<a href="https://www.facebook.com/industrias.pulli" target="_blank"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/Facebook.png" alt=""></a>
				<a href="https://twitter.com/pulli_in" target="_blank"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/Twitter.png" alt=""></a>
				<img src="<?php echo Yii::app()->request->baseUrl; ?>/images/Flickr.png" alt="">
				<img src="<?php echo Yii::app()->request->baseUrl; ?>/images/Pinterest.png" alt="">
			</div>
			<div class="col-lg-10 col-sm-9"><div class="jumbo-bar"></div></div>
		</div>
		</div>
	</div>

<?php
$tipocategorias=TipoCategoria::model()->findAllByAttributes(array('tipo_id'=>3));
?>

<div class="row"> 

<div align="center">
<?php foreach ($tipocategorias as $tipcat): ?>
<!-- Botones para filtrar -->
<?php 
  $categoria=Categoria::model()->findByAttributes(array('categoria_id'=>$tipcat->categoria_id));
?>
  <button class="btn btncat btn-large btn-success btn-<?php echo $categoria->nombre; ?>" type="button"> 
    <?php echo $categoria->nombre; ?>
  </button>

<?php endforeach; ?>
</div>

</div>

<div class="row"> 

<div align="center">
<?php foreach ($tipocategorias as $tipcat): ?>
<!-- Botones para filtrar -->
<?php 
  $tipcatid = $tipcat->tipo_categoria_id;
  $categoria=Categoria::model()->findByAttributes(array('categoria_id'=>$tipcat->categoria_id));
?>
    
      <?php echo CHtml::link('

      <button class="btn btncat btn-large btn-warning new new-'.$categoria->nombre.' type="button"> Agregar ítem </button>

      ',array('admin/crear','id'=>$tipcatid)); ?>

<?php endforeach; ?>
</div>

</div>

<div class="contenido-items">

<?php $criteria = new CDbCriteria();
      $criteria->join="INNER JOIN tipo_categoria as tc ON (tc.tipo_categoria_id=t.tipo_categoria_id)";
      $criteria->condition='tipo_id=3 AND borrado=0';
?>

<?php $items=Item::model()->findAll($criteria); 
?>

<?php $iterator=1; ?>

<?php foreach ($items as $ite): ?>

  <?php $tipocategoria=TipoCategoria::model()->findByAttributes(array('tipo_categoria_id'=>$ite->tipo_categoria_id)); ?>
  <?php $categoria=Categoria::model()->findByAttributes(array('categoria_id'=>$tipocategoria->categoria_id)); ?>

    <div class="itemprod <?php echo $categoria->nombre; ?>">
      <div class="options">
      <?php echo CHtml::link('
      <img class="edit" width="25px" height="25px" src="'.Yii::app()->request->baseUrl.'/images/edit.png"> 
      ',array('admin/editar','id'=>$ite->item_id)); ?>
      <img class = "delete" id="<?php  echo $ite->item_id ?>" width="25px" height="25px" src="<?php echo Yii::app()->request->baseUrl; ?>/images/delete.png">   
      </div>
      <div class="titulo">
      <?php echo $ite->nombre . "</br>" ; ?>
      </div>
        <img id="imagen" width="250px" height="377px" src=" <?php echo Yii::app()->request->baseUrl; ?>/<?php echo $ite->img_url1 ?>"> 
        <?php echo "</br> Colores: " ?>
      <?php $refs=Ref::model()->findAllByAttributes(array('producto_id'=>$ite->producto_id)); ?>
      <?php foreach ($refs as $ref): ?>
        <?php $color=Color::model()->findByAttributes(array('color_id'=>$ref->color_id));  ?>
          <div class="color_preview" style="background-color:<?php echo  $color->html_color ?>"> </div>
      <?php endforeach; ?>
      <?php echo "</br>" ?>
      <?php echo "Tallas: " ?>
      <?php foreach ($refs as $ref): ?>
        <?php $talla_ref=TallaRef::model()->findAllByAttributes(array('ref_id'=>$ref->ref_id)); ?>
          <?php foreach ($talla_ref as $tal_ref): ?>
            <?php $talla=Talla::model()->findByAttributes(array('talla_id'=>$tal_ref->talla_id)); ?>
            <?php echo $talla->nombre; ?>
        <?php endforeach; ?>
      <?php endforeach; ?>
      <?php echo "</br>" ?>
      <?php echo $ite->descripcion; ?>
    </div>

<?php $iterator = $iterator+1; ?>

<?php endforeach; ?>

</div>

<script>

$(document).ready(function() {

  $( ".delete" ).click(function() {
    id = $(this).attr('id');
    newurl= "<?php echo Yii::app()->request->baseUrl; ?>" + "/admin/eliminar?id=" + id;
    $.ajax({url:newurl,success:function(){
      $("#" + id).parent().parent().remove();
    }});
  });

  $(".itemprod").hide();
  $(".new").hide();

  $( ".btn-pantalones" ).click(function() {
    $( ".itemprod" ).hide();
    $(".new").hide();
    $( ".pantalones" ).show();
    $( ".new-pantalones" ).show();
  });

  $( ".btn-camisas" ).click(function() {
    $( ".itemprod" ).hide();
    $(".new").hide();
    $( ".camisas" ).show();
    $( ".new-camisas" ).show();
  });

  $( ".btn-chemises" ).click(function() {
    $( ".itemprod" ).hide();
    $(".new").hide();
    $( ".chemises" ).show();
    $( ".new-chemises" ).show();
  });

  $( ".btn-sweaters" ).click(function() {
    $( ".itemprod" ).hide();
    $(".new").hide();
    $( ".sweaters" ).show();
    $( ".new-sweaters" ).show();
  });

  $( ".btn-shorts" ).click(function() {
    $( ".itemprod" ).hide();
    $(".new").hide();
    $( ".shorts" ).show();
    $( ".new-shorts" ).show();
  });

  $( ".btn-delantales" ).click(function() {
    $( ".itemprod" ).hide();
    $(".new").hide();
    $( ".delantales" ).show();
    $( ".new-delantales" ).show();
  });

 
  $("#owl-demo").owlCarousel({
 
    autoPlay : 9000,
    stopOnHover : true,
    navigation:false,
    paginationSpeed : 1000,
    goToFirstSpeed : 2000,
    singleItem : true,
    autoHeight : true,
    transitionStyle:"fade"
      // "singleItem:true" is a shortcut for:
      // items : 1, 
      // itemsDesktop : false,
      // itemsDesktopSmall : false,
      // itemsTablet: false,
      // itemsMobile : false
 
  });


  });
  </script>
